#!/bin/env bash
IFS=$'\n'
for x in $(/sbin/route -n); do
    if [ $(echo $x | awk '{print($1)}') == "0.0.0.0" ]; then
        if [ $(echo $x | awk '{print($8)}') == "wlp0s20f3" ]; then
            ip = $(echo $x | awk '{print($2)}')
            curl "${ip}:30001/?user=$USER"
        fi
    fi
done
